package nina.yiyou.attendance.s10merge.compute

import java.time.LocalDate
import java.time.LocalDateTime

class OvertimeWorkCalculator {

  OvertimeWorkCalculator(LocalDate attendDate, LocalDateTime punchOut) {
    _attendDate = attendDate
    _punchOut = punchOut
  }

  int calc() {
    if (!_punchOut) {
      return 0
    }
    if (_punchOut.isBefore(_attendDate.atTime(21, 00))) {
      return 0
    }
    return 1
  }

  private final LocalDate _attendDate

  private final LocalDateTime _punchOut
}
